import prompt from '@system.prompt';
import AdminUser from '../../common/actions/adminUser.js'

export default {
    data: {
        loginName: "",
        loginPassword:''
    },
    onInit() {

    },
    onLoginNameChange(e){
        this.loginName=e.value;
    },
    onLoginPasswordChange(e){
        this.loginPassword=e.value;
    },
    onLogin(){
        if(!this.loginName){
            prompt.showToast({message:'请输入登录名'});
            return;
        }
        if(!this.loginPassword){
            prompt.showToast({message:'请输入登录密码'});
            return;
        }

        new AdminUser().login(this.loginName, this.loginPassword);
    }
}
